package generic;

import java.util.ArrayList;
/**
 * @Author:Cjj
 * @Date:2025/6/16
 */
public class ArrayListDemo {
    public static void main(String[] args) {
        ArrayList<Integer> list=new ArrayList<>();
         list.add(1);
         list.add(2);
         list.add(3);
         int val=list.get(2);
        System.out.println(val);
        System.out.println(list);

        ArrayList<String> strList=new ArrayList<>();
        strList.add("s1");
        strList.add("s3");
        strList.add("s6");
        System.out.println(strList);
    }
}
